﻿
@{
    ViewBag.Title = "NodeJSSocketIO";
}

<h2>NodeJSSocketIO</h2>
<div class="future-cop">
    <h3 class="future">Halitney</h3>
    <h1 class="cop">TWICE</h1>
</div>

<br />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.16/socket.io.min.js"></script>
    <script>
        //var socket = io.connect('http://localhost:801');
        var socket = io.connect('http://nodejs-guyhalperin.rhcloud.com:80');

        socket.on('news', function (data) {
            console.log(data);
            socket.emit('my other event', { my: 'data' });
        });

        function emit() {
            //alert('hi');

            socket.emit('YES', { hihi: 'newData12' });
        }
    </script>

    <input type="button" title="EMIT NEW!" value="Emit:)" onclick="emit()" />
